<template>
  <div class="err-transition fl" :style="{ width: calcWidth }">
    <div ref="item" style="margin-right:6px;margin-left: 6px;">
      <el-form-item v-bind="$attrs" class="query-search" style="width: 100%">
        <slot></slot>
      </el-form-item>
    </div>
  </div>
</template>

<script setup lang="ts">
const props = defineProps({
  label: {
      type: String
    },
    width: {
      type: String,
      default: '20'
    }
})
  const calcWidth = computed(() => {
      return props.width >= 300 ? '40%' : props.width > 40 ? '20%' : props.width + '%'
    })
</script>
<script lang="ts">
export default {
    name: 'search-frame-item'
}
</script>

<style lang="scss">
// @import '@/styles/mixin.scss';

.search-frame .el-form {
  display: block;
}
// 条件查询class
.err-transition {
    min-width: 210px;
  transition: margin-bottom .5s;
  height: 45px;
  .query-search.is-error{
   margin-bottom: 20px;
  }
  .el-form-item__label{
    min-width: 100px;
    text-align: left;
  }
  .query-search {
    width: 100%;
    margin-bottom: 4px;
    transition: margin-bottom 1s;
    display: flex;
    .el-form-item__content {
      width: 100%;
      .el-select,
      .el-cascader,
      .el-input {
        width: 100%;
        .el-input__inner,
        .el-cascader__label {
          height: 32px;
          // @include text-hide;
        }
        .el-cascader__label {
          line-height: 36px;
        }
        .el-input__prefix {
          text-align: left;
          min-width: 40px;
          color: #303133;
          line-height: 40px;
        }
      }
      .el-date-editor{
          width: 100% !important;
      }
      .el-range-editor--small.el-input__inner{
        font-size: 14px;
        height: 32px;
        .el-input__icon {
          line-height: 28px;
        }
      }
    }
  }
}
</style>
